package cn.edu.scau.cmi.dengzejun.chapter11;

import javax.swing.*;
import java.awt.*;

public class WindowActionEvent extends JFrame{
	JTextField text;
	ReaderListen listener;
	public WindowActionEvent() {
		init();
		this.setVisible(true);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		return;
	}
	
	private void init() {
		this.setLayout(new FlowLayout());
		text = new JTextField(10);
		listener = new ReaderListen();
		text.addActionListener(listener);
		this.add(text);
		return;
	}
}
